home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / DVD / DVDSample / dvdsample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-31  |  4.3 KB  |  136 lines

  1. //------------------------------------------------------------------------------
  2. // File: DvdSample.h
  3. //
  4. // Desc: DVD Playback sample app using IDvdGraphBuilder,
  5. //       IDvdInfo2, and IDvdControl2 interfaces.
  6. //
  7. //       This contains headers for all Windows-related "plumbing" for the application
  8. //
  9. // Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
  10. //------------------------------------------------------------------------------
  11.  
  12. //------------------------------------------------------------------------------
  13. // Class Forward Declarations
  14. //------------------------------------------------------------------------------
  15.  
  16. class CDvdCore;
  17. class CParentLevels;
  18. class CApp;
  19. extern CApp g_App;
  20. class CSPLangDlg;
  21. class CAudioLangDlg;
  22. class CDVDLanguages; 
  23. class CAngleDlg;
  24. class CKaraokeDlg;
  25.  
  26.  
  27.  
  28.  
  29. //------------------------------------------------------------------------------
  30. // Name: class CApp
  31. // Desc: This class contains the application interface
  32. //------------------------------------------------------------------------------
  33.  
  34. class CApp : public IDvdCallback
  35. {
  36.     friend CSPLangDlg;
  37.     friend CAudioLangDlg;
  38.     friend CAngleDlg;
  39.     friend CKaraokeDlg;
  40.  
  41. public:
  42.     RECT GetAppWindow(void);
  43.     void Prohibited( void );
  44.     void Exit( void );
  45.     static BOOL CALLBACK SelectParentalLevel(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  46.     bool InitInstance(int nCmdShow);
  47.     inline const TCHAR * GetAppName(void) const { return m_szAppName; };
  48.     void SetAppValues(HINSTANCE hInst, PTSTR szAppName, int iAppTitleResId);
  49.     CApp();
  50.     virtual ~CApp();
  51.     static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ;
  52.     void UpdateStatus(void); // to implement the IDvdCallback interface requirements
  53.  
  54. private:
  55.     LRESULT MenuProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
  56.     LRESULT KeyProc(WPARAM wParam, LPARAM lParam);
  57.     bool OnSelectDisc(void);
  58.     void DrawStatus(HDC hDC);
  59.     int MakeParentLevelList(HWND hDlg, int iListID);
  60.     LRESULT ToolTipProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  61.  
  62.     DWORD               m_dwProhibitedTime;
  63.     HWND                m_hwndToolBar;
  64.     CDVDLanguages *     m_pLangLookup;
  65.     bool                m_bFullScreenOn;
  66.     bool                m_bCaptionsOn;
  67.     CDvdCore *          m_pDvdCore;
  68.     HWND                m_hWnd;
  69.     TCHAR               m_szAppName[50] ;   // internal name of the app
  70.     TCHAR               m_szAppTitle[50];   // title bar text
  71.     HINSTANCE           m_hInstance;
  72.     CParentLevels *     m_pParentLevels;
  73. };
  74.  
  75.  
  76. //------------------------------------------------------------------------------
  77. // Name: class CParentLevels
  78. // Desc: This is a class to wrap the viewing level numbers and names.
  79. //       This makes it easy to add viewing level definitions or change them to, 
  80. //       say, those of another country.
  81. //------------------------------------------------------------------------------
  82. const int LEVELS = 6;
  83. class CParentLevels 
  84. {
  85. public:
  86.     CParentLevels() ;
  87.  
  88.     int     GetCount(void)   { return m_iCount ; } ;
  89.     LPCTSTR GetName(int i)   { return m_alpszNames[i] ; } ;
  90.     int     GetValue(int i)  { return m_aiValues[i] ; } ;
  91.  
  92. private:
  93.     LPCTSTR   m_alpszNames[LEVELS] ;
  94.     int       m_aiValues[LEVELS] ;
  95.     int       m_iCount ;
  96. } ;
  97.  
  98.  
  99. //------------------------------------------------------------------------------
  100. // Name: class CDVDLanguages
  101. // Desc: A class to wrap a few language names and the corresponding 2-char codes
  102. //       We have only 10 languages from ISO 639 as a sample. It can be extended to
  103. //       include any other language in ISO 639.
  104. //------------------------------------------------------------------------------
  105. class CDVDLanguages 
  106. {
  107. public:
  108.     CDVDLanguages() ;
  109.  
  110.     bool GetLangString(LCID LangCode, PTSTR pszLang, int iMaxLen) ;
  111.  
  112. private:
  113.     LCID  m_lcidCodes[10] ;
  114.     LPCTSTR  m_apszLangNames[10] ;
  115. } ;
  116.  
  117. //------------------------------------------------------------------------------
  118. // Remove Debug logging
  119. //------------------------------------------------------------------------------
  120. #ifndef DbgLog
  121. #define DbgLog(a)
  122. #endif
  123. #ifndef ASSERT
  124. #define ASSERT(x)
  125. #endif
  126.  
  127. #ifndef DbgInitialise
  128. #define DbgInitialise(x) 
  129. #endif
  130.  
  131. #ifndef DbgTerminate
  132. #define DbgTerminate()
  133. #endif
  134.  
  135. #pragma warning ( disable : 4390 )
  136.